<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //99.14%
    var fib = function(N) {
        if(N==0)return 0;
        if(N==1)return 1;
        let n=0,pre1=0,pre2=1;
        N=N-1;
        while(N--){
            n = pre1 + pre2;
            pre1 = pre2;
            pre2 = n;
        }
        return n;
    };
    console.log(fib(7));
    
</script>
</html>